﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class admin_adminlogin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        //khoi tao doi tuong la set gia tri
        Admin objAdmin = new Admin();
        objAdmin.AdmUser = txtUsername.Text;
        objAdmin.AdmPass = txtPassword.Text;
        //khoi tao lop adminbus
        AdminBus AdminBus = new AdminBus();
        if (AdminBus.checkAdminLogin(objAdmin))
        {
            Session["adminlogin"] = "thanhnx";
            Response.Redirect("Default.aspx");
        }
        else
        {
            LabelMsg.Text = "Wrong Username or Password";
        }
    }
}
